<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>签到效果实现</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="https://cdn.bootcss.com/jquery/1.8.3/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="sign.css"/>
    <script type="text/javascript" src="calendar.js"></script>
    <script type="text/javascript">
      /*  $(function(){
            //ajax获取日历json数据
            var signList=[{"signDay":"10", "type": 1},{"signDay":"11", "type": 1},{"signDay":"12", "type":2},{"signDay":"13", "type":2}];
            calUtil.init(signList);
        });*/
    </script>
</head>
<body>

<script>


    function nextMouthStr(dateStr) {
        let date = new Date(dateStr);
        let y = date.getFullYear();
        let m = date.getMonth()+2;
        let d = date.getDate();

        if (m > 12) {
            y++;
            m -= 12;
        }
        return (y+'/'+m+'/'+d);
    }
    function prevMouthStr(dateStr) {
        let date = new Date('2018/1/1');
        let y = date.getFullYear();
        let m = date.getMonth();
        let d = date.getDate();

        if (m <= 0) {
            y--;
            m += 12;
        }
        return (y+'/'+m+'/'+d);
    }
    // let nDate = new Date(str)

    console.log(str);
    console.log(nextMouthStr('2018/12/1'));
</script>
</body>
</html>